GtkWidget: Do not reset GtkStyleContext per get_style_context().
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 18 Jun 2010 15:25:53 +0000 (17:25 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:37:13 +0000 (15:37 +0100)
gtk/gtkwidget.c

index ed3a8fd1825babc1298975819cac03a19c7faeb4..3235f5c13b5de7b84cab4107f9cdd6df1696699c 100644 (file)
@@ -13271,18 +13271,19 @@ gtk_widget_get_style_context (GtkWidget *widget)
           g_object_unref (css_file);
         }
 
-      gtk_style_context_add_provider (context, css_provider,
+      gtk_style_context_add_provider (context,
+                                      GTK_STYLE_PROVIDER (css_provider),
                                       GTK_STYLE_PROVIDER_PRIORITY_USER);
-    }
 
-  if (widget->parent ||
-      gtk_widget_is_toplevel (widget))
-    {
-      GtkWidgetPath *path;
+      if (widget->parent ||
+          gtk_widget_is_toplevel (widget))
+        {
+          GtkWidgetPath *path;
 
-      path = gtk_widget_get_path (widget);
-      gtk_style_context_set_path (context, path);
-      gtk_widget_path_free (path);
+          path = gtk_widget_get_path (widget);
+          gtk_style_context_set_path (context, path);
+          gtk_widget_path_free (path);
+        }
     }
 
   return context;